#include "IO/io.hpp"
#include "IO/opencv_factory.hpp"

IO::IO():Listener("Output")
{
	// init
	param = Config1::Instance();
	IOFactory* factory = OpenCVFactory::GetFactoryInstance();
	m_impl = factory ->MakeIO();
}

IO::~IO()
{
}

int IO::GetImage(Image& image)
{
	if(m_impl->GetImage(image))
		return 1;
	return 0;
}

int IO::GetImageFromImage(Image& image, const string src)
{
	if(m_impl->GetImageFromImage(image, src))
		return 1;
	return 0;
}

void IO::Update(Image& image)
{
	m_impl->Update(image);
}

int IO::WriteImage(const Image& image, const string src)
{
	if(m_impl->WriteImage(image, src))
		return 1;
	return 0;
}
